//
//  changePhoneNumberController.m
//  pacc
//
//  Created by 测试 on 2018/5/24.
//  Copyright © 2018年 测试. All rights reserved.
//

#import "changePhoneNumberController.h"

@interface changePhoneNumberController ()
@property (weak, nonatomic) IBOutlet UITextField *oldPhone;
@property (weak, nonatomic) IBOutlet UITextField *oldCode;
@property (weak, nonatomic) IBOutlet UITextField *nPhone;
@property (weak, nonatomic) IBOutlet UITextField *nCode;
- (IBAction)getoldCodeClick:(id)sender;
- (IBAction)geytNewCodeClick:(id)sender;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topConstraint;

@end

@implementation changePhoneNumberController

- (void)viewDidLoad {
    [super viewDidLoad];
    if (_isFromWO) {
        _topConstraint.constant =0;
    }
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)sureClick:(id)sender {
    NSString *oldPhoneNum = _oldPhone.text;
    NSString *oldcode = _oldCode.text;
    NSString *newPhoneNum = _nPhone.text;
    NSString *newcode = _nCode.text;
    [NetWorking startPOSTRequestWithUrl:[NSString stringWithFormat:@"userupdatePassword"] parameters:@{@"oldPhone":oldPhoneNum,@"oldCode":oldcode,@"newPhone":newPhoneNum,@"newCode":newcode} logMes:@"修改手机号" show:YES success:^(NSDictionary *data) {
        NSLog(@"==%@",data);
    } failure:^(NSError *error) {
        
    }];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)getoldCodeClick:(UIButton*)sender {
    [NetWorking getCode:_oldPhone.text btn:sender];
}

- (IBAction)geytNewCodeClick:(UIButton*)sender {
    [NetWorking getCode:_nPhone.text btn:sender];
}

@end
